using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace InvestmentIntelligence.DbModel.Models
{
    using System.ComponentModel.DataAnnotations.Schema;

    [Table("SecurityView", Schema = "MarketData")]
   public  class SecurityView
    {
        public string Currency { get; set; }

        public string Country { get; set; }

        public string Sector { get; set; }

        public string Class { get; set; }

        public string Isin { get; set; }

        public string Ticker { get; set; }

        public string Ric { get; set; }

        public string Name { get; set; }

        [Key]
        public int Id { get; set; }

        public int? ParentId { get; set; }
    }

    public class SecurityViewComparer : IEqualityComparer<SecurityView>
    {
        public static SecurityViewComparer Instance = new SecurityViewComparer();

        public bool Equals(SecurityView x, SecurityView y)
        {
            return x.Id == y.Id;
        }

        public int GetHashCode(SecurityView obj)
        {
            return obj.Id;
        }
    }
}
